--影袭
local yingxi = fk.CreateSkill {
    name = "mcdh_yingxi",
    tags = {Skill.Hidden}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

yingxi:addEffect(U.GeneralAppeared,{
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(self)
    end,
    on_cost = function(self, event, target, player, data)
        local room =player.room
        local dat =U.askForUseVirtualCard(room,player,"slash",nil,self.name,"#yingxi",true,true,true,false,nil,true)
        if dat then
            self.cost_data = dat
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:useCard(self.cost_data)
        room:setPlayerMark(player,"@@yingxi",1)
    end
})

yingxi:addEffect(fk.DamageInflicted,{
    can_trigger = function(self, event, target, player, data)
        return target == player and player:getMark("@@yingxi") ~= 0
    end,
    on_cost =function(self, event, target, player, data)
        return true
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:setPlayerMark(player,"@@yingxi",0)
        return true
    end
})

Fk:loadTranslationTable {
    ["mcdh_yingxi"] = "影袭",
    [":mcdh_yingxi"] = "<br>隐匿技，当你登场后，你可以视为对一名其他角色使用一张【杀】并防止你下一次受到的伤害。",
    ["#yingxi"] = "影袭:视为使用一张无距离限制的杀并防止你下一次受到的伤害",
    ["@@yingxi"] = "影袭"
}

return yingxi